<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP, MagicHash, ScopedTypeVariables #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# OPTIONS_GHC -optc-DNON_POSIX_SOURCE #-}</span><span>
</span><span id="line-3"></span><span class="hs-comment">--</span><span>
</span><span id="line-4"></span><span class="hs-comment">--  (c) The University of Glasgow 2002-2006</span><span>
</span><span id="line-5"></span><span class="hs-comment">--</span><span>
</span><span id="line-6"></span><span>
</span><span id="line-7"></span><span class="hs-comment">-- | Generate infotables for interpreter-made bytecodes</span><span>
</span><span id="line-8"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.ByteCode.InfoTable</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.ByteCode.InfoTable.html#mkITbls"><span class="hs-identifier">mkITbls</span></a></span><span> </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-12"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-13"></span><span>
</span><span id="line-14"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#"><span class="hs-identifier">GHC.Platform</span></a></span><span>
</span><span id="line-15"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.ByteCode.Types.html"><span class="hs-identifier">GHC.ByteCode.Types</span></a></span><span>
</span><span id="line-16"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Runtime.Interpreter.html"><span class="hs-identifier">GHC.Runtime.Interpreter</span></a></span><span>
</span><span id="line-17"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-18"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html"><span class="hs-identifier">GHC.Driver.Types</span></a></span><span>
</span><span id="line-19"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.html"><span class="hs-identifier">GHC.Types.Name</span></a></span><span>       </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier">Name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#getName"><span class="hs-identifier">getName</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-20"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Env.html"><span class="hs-identifier">GHC.Types.Name.Env</span></a></span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html"><span class="hs-identifier">GHC.Core.DataCon</span></a></span><span>     </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier">DataCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#dataConRepArgTys"><span class="hs-identifier">dataConRepArgTys</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#dataConIdentity"><span class="hs-identifier">dataConIdentity</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html"><span class="hs-identifier">GHC.Core.TyCon</span></a></span><span>       </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier">TyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConFamilySize"><span class="hs-identifier">tyConFamilySize</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#isDataTyCon"><span class="hs-identifier">isDataTyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConDataCons"><span class="hs-identifier">tyConDataCons</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Multiplicity.html"><span class="hs-identifier">GHC.Core.Multiplicity</span></a></span><span>     </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#scaledThing"><span class="hs-identifier">scaledThing</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html"><span class="hs-identifier">GHC.Types.RepType</span></a></span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Layout.html"><span class="hs-identifier">GHC.StgToCmm.Layout</span></a></span><span>  </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Layout.html#mkVirtConstrSizes"><span class="hs-identifier">mkVirtConstrSizes</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Closure.html"><span class="hs-identifier">GHC.StgToCmm.Closure</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Closure.html#tagForCon"><span class="hs-identifier">tagForCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Closure.html#NonVoid"><span class="hs-identifier">NonVoid</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Panic.html"><span class="hs-identifier">GHC.Utils.Panic</span></a></span><span>
</span><span id="line-29"></span><span>
</span><span id="line-30"></span><span class="hs-comment">{-
  Manufacturing of info tables for DataCons
-}</span><span>
</span><span id="line-33"></span><span>
</span><span id="line-34"></span><span class="hs-comment">-- Make info tables for the data decls in this module</span><span>
</span><span id="line-35"></span><span class="annot"><a href="GHC.ByteCode.InfoTable.html#mkITbls"><span class="hs-identifier hs-type">mkITbls</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.ByteCode.Types.html#ItblEnv"><span class="hs-identifier hs-type">ItblEnv</span></a></span><span>
</span><span id="line-36"></span><span id="mkITbls"><span class="annot"><span class="annottext">mkITbls :: HscEnv -&gt; [TyCon] -&gt; IO ItblEnv
</span><a href="GHC.ByteCode.InfoTable.html#mkITbls"><span class="hs-identifier hs-var hs-var">mkITbls</span></a></span></span><span> </span><span id="local-6989586621681067881"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681067881"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621681067880"><span class="annot"><span class="annottext">[TyCon]
</span><a href="#local-6989586621681067880"><span class="hs-identifier hs-var">tcs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-37"></span><span>  </span><span class="annot"><span class="annottext">(ItblEnv -&gt; ItblEnv -&gt; ItblEnv) -&gt; ItblEnv -&gt; [ItblEnv] -&gt; ItblEnv
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">ItblEnv -&gt; ItblEnv -&gt; ItblEnv
forall a. NameEnv a -&gt; NameEnv a -&gt; NameEnv a
</span><a href="GHC.Types.Name.Env.html#plusNameEnv"><span class="hs-identifier hs-var">plusNameEnv</span></a></span><span> </span><span class="annot"><span class="annottext">ItblEnv
forall a. NameEnv a
</span><a href="GHC.Types.Name.Env.html#emptyNameEnv"><span class="hs-identifier hs-var">emptyNameEnv</span></a></span><span> </span><span class="annot"><span class="annottext">([ItblEnv] -&gt; ItblEnv) -&gt; IO [ItblEnv] -&gt; IO ItblEnv
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span>
</span><span id="line-38"></span><span>    </span><span class="annot"><span class="annottext">(TyCon -&gt; IO ItblEnv) -&gt; [TyCon] -&gt; IO [ItblEnv]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; TyCon -&gt; IO ItblEnv
</span><a href="#local-6989586621681067874"><span class="hs-identifier hs-var">mkITbl</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681067881"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(TyCon -&gt; Bool) -&gt; [TyCon] -&gt; [TyCon]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isDataTyCon"><span class="hs-identifier hs-var">isDataTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">[TyCon]
</span><a href="#local-6989586621681067880"><span class="hs-identifier hs-var">tcs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-39"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-40"></span><span>  </span><span class="annot"><a href="#local-6989586621681067874"><span class="hs-identifier hs-type">mkITbl</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.ByteCode.Types.html#ItblEnv"><span class="hs-identifier hs-type">ItblEnv</span></a></span><span>
</span><span id="line-41"></span><span>  </span><span id="local-6989586621681067874"><span class="annot"><span class="annottext">mkITbl :: HscEnv -&gt; TyCon -&gt; IO ItblEnv
</span><a href="#local-6989586621681067874"><span class="hs-identifier hs-var hs-var">mkITbl</span></a></span></span><span> </span><span id="local-6989586621681067873"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681067873"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621681067872"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681067872"><span class="hs-identifier hs-var">tc</span></a></span></span><span>
</span><span id="line-42"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">[DataCon]
</span><a href="#local-6989586621681067871"><span class="hs-identifier hs-var">dcs</span></a></span><span> </span><span class="annot"><span class="annottext">[DataCon] -&gt; Int -&gt; Bool
forall a. [a] -&gt; Int -&gt; Bool
</span><a href="GHC.Utils.Misc.html#lengthIs"><span class="hs-operator hs-var">`lengthIs`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681067869"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-comment">-- paranoia; this is an assertion.</span><span>
</span><span id="line-43"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; [DataCon] -&gt; IO ItblEnv
</span><a href="GHC.ByteCode.InfoTable.html#make_constr_itbls"><span class="hs-identifier hs-var">make_constr_itbls</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681067873"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">[DataCon]
</span><a href="#local-6989586621681067871"><span class="hs-identifier hs-var">dcs</span></a></span><span>
</span><span id="line-44"></span><span>       </span><span class="hs-keyword">where</span><span>
</span><span id="line-45"></span><span>          </span><span id="local-6989586621681067871"><span class="annot"><span class="annottext">dcs :: [DataCon]
</span><a href="#local-6989586621681067871"><span class="hs-identifier hs-var hs-var">dcs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; [DataCon]
</span><a href="GHC.Core.TyCon.html#tyConDataCons"><span class="hs-identifier hs-var">tyConDataCons</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681067872"><span class="hs-identifier hs-var">tc</span></a></span><span>
</span><span id="line-46"></span><span>          </span><span id="local-6989586621681067869"><span class="annot"><span class="annottext">n :: Int
</span><a href="#local-6989586621681067869"><span class="hs-identifier hs-var hs-var">n</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Int
</span><a href="GHC.Core.TyCon.html#tyConFamilySize"><span class="hs-identifier hs-var">tyConFamilySize</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681067872"><span class="hs-identifier hs-var">tc</span></a></span><span>
</span><span id="line-47"></span><span>  </span><span class="annot"><a href="#local-6989586621681067874"><span class="hs-identifier hs-var">mkITbl</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO ItblEnv
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;mkITbl&quot;</span></span><span>
</span><span id="line-48"></span><span>
</span><span id="line-49"></span><span class="annot"><a href="GHC.ByteCode.InfoTable.html#mkItblEnv"><span class="hs-identifier hs-type">mkItblEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.ByteCode.Types.html#ItblPtr"><span class="hs-identifier hs-type">ItblPtr</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.ByteCode.Types.html#ItblEnv"><span class="hs-identifier hs-type">ItblEnv</span></a></span><span>
</span><span id="line-50"></span><span id="mkItblEnv"><span class="annot"><span class="annottext">mkItblEnv :: [(Name, ItblPtr)] -&gt; ItblEnv
</span><a href="GHC.ByteCode.InfoTable.html#mkItblEnv"><span class="hs-identifier hs-var hs-var">mkItblEnv</span></a></span></span><span> </span><span id="local-6989586621681067865"><span class="annot"><span class="annottext">[(Name, ItblPtr)]
</span><a href="#local-6989586621681067865"><span class="hs-identifier hs-var">pairs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Name, (Name, ItblPtr))] -&gt; ItblEnv
forall a. [(Name, a)] -&gt; NameEnv a
</span><a href="GHC.Types.Name.Env.html#mkNameEnv"><span class="hs-identifier hs-var">mkNameEnv</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681067863"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681067863"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">ItblPtr
</span><a href="#local-6989586621681067862"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681067863"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681067863"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681067862"><span class="annot"><span class="annottext">ItblPtr
</span><a href="#local-6989586621681067862"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(Name, ItblPtr)]
</span><a href="#local-6989586621681067865"><span class="hs-identifier hs-var">pairs</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-51"></span><span>
</span><span id="line-52"></span><span class="hs-comment">-- Assumes constructors are numbered from zero, not one</span><span>
</span><span id="line-53"></span><span class="annot"><a href="GHC.ByteCode.InfoTable.html#make_constr_itbls"><span class="hs-identifier hs-type">make_constr_itbls</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.ByteCode.Types.html#ItblEnv"><span class="hs-identifier hs-type">ItblEnv</span></a></span><span>
</span><span id="line-54"></span><span id="make_constr_itbls"><span class="annot"><span class="annottext">make_constr_itbls :: HscEnv -&gt; [DataCon] -&gt; IO ItblEnv
</span><a href="GHC.ByteCode.InfoTable.html#make_constr_itbls"><span class="hs-identifier hs-var hs-var">make_constr_itbls</span></a></span></span><span> </span><span id="local-6989586621681067861"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681067861"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621681067860"><span class="annot"><span class="annottext">[DataCon]
</span><a href="#local-6989586621681067860"><span class="hs-identifier hs-var">cons</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-55"></span><span>  </span><span class="annot"><span class="annottext">[(Name, ItblPtr)] -&gt; ItblEnv
</span><a href="GHC.ByteCode.InfoTable.html#mkItblEnv"><span class="hs-identifier hs-var">mkItblEnv</span></a></span><span> </span><span class="annot"><span class="annottext">([(Name, ItblPtr)] -&gt; ItblEnv)
-&gt; IO [(Name, ItblPtr)] -&gt; IO ItblEnv
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">((DataCon, Int) -&gt; IO (Name, ItblPtr))
-&gt; [(DataCon, Int)] -&gt; IO [(Name, ItblPtr)]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(DataCon -&gt; Int -&gt; IO (Name, ItblPtr))
-&gt; (DataCon, Int) -&gt; IO (Name, ItblPtr)
forall a b c. (a -&gt; b -&gt; c) -&gt; (a, b) -&gt; c
</span><a href="../../base/src/Data.Tuple.html#uncurry"><span class="hs-identifier hs-var">uncurry</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; Int -&gt; IO (Name, ItblPtr)
</span><a href="#local-6989586621681067858"><span class="hs-identifier hs-var">mk_itbl</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[DataCon] -&gt; [Int] -&gt; [(DataCon, Int)]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-identifier hs-var">zip</span></a></span><span> </span><span class="annot"><span class="annottext">[DataCon]
</span><a href="#local-6989586621681067860"><span class="hs-identifier hs-var">cons</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-glyph">..</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-56"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-57"></span><span>  </span><span id="local-6989586621681067857"><span class="annot"><span class="annottext">dflags :: DynFlags
</span><a href="#local-6989586621681067857"><span class="hs-identifier hs-var hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681067861"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-58"></span><span>
</span><span id="line-59"></span><span>  </span><span class="annot"><a href="#local-6989586621681067858"><span class="hs-identifier hs-type">mk_itbl</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.ByteCode.Types.html#ItblPtr"><span class="hs-identifier hs-type">ItblPtr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-60"></span><span>  </span><span id="local-6989586621681067858"><span class="annot"><span class="annottext">mk_itbl :: DataCon -&gt; Int -&gt; IO (Name, ItblPtr)
</span><a href="#local-6989586621681067858"><span class="hs-identifier hs-var hs-var">mk_itbl</span></a></span></span><span> </span><span id="local-6989586621681067855"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681067855"><span class="hs-identifier hs-var">dcon</span></a></span></span><span> </span><span id="local-6989586621681067854"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681067854"><span class="hs-identifier hs-var">conNo</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-61"></span><span>     </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681067851"><span class="annot"><span class="annottext">rep_args :: [NonVoid PrimRep]
</span><a href="#local-6989586621681067851"><span class="hs-identifier hs-var hs-var">rep_args</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">PrimRep -&gt; NonVoid PrimRep
forall a. a -&gt; NonVoid a
</span><a href="GHC.StgToCmm.Closure.html#NonVoid"><span class="hs-identifier hs-var">NonVoid</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="#local-6989586621681067849"><span class="hs-identifier hs-var">prim_rep</span></a></span><span>
</span><span id="line-62"></span><span>                    </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681067848"><span class="annot"><span class="annottext">Scaled Type
</span><a href="#local-6989586621681067848"><span class="hs-identifier hs-var">arg</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [Scaled Type]
</span><a href="GHC.Core.DataCon.html#dataConRepArgTys"><span class="hs-identifier hs-var">dataConRepArgTys</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681067855"><span class="hs-identifier hs-var">dcon</span></a></span><span>
</span><span id="line-63"></span><span>                    </span><span class="hs-special">,</span><span> </span><span id="local-6989586621681067849"><span class="annot"><span class="annottext">PrimRep
</span><a href="#local-6989586621681067849"><span class="hs-identifier hs-var">prim_rep</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; [PrimRep]
Type -&gt; [PrimRep]
</span><a href="GHC.Types.RepType.html#typePrimRep"><span class="hs-identifier hs-var">typePrimRep</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Scaled Type -&gt; Type
forall a. Scaled a -&gt; a
</span><a href="GHC.Core.TyCo.Rep.html#scaledThing"><span class="hs-identifier hs-var">scaledThing</span></a></span><span> </span><span class="annot"><span class="annottext">Scaled Type
</span><a href="#local-6989586621681067848"><span class="hs-identifier hs-var">arg</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-64"></span><span>
</span><span id="line-65"></span><span>         </span><span class="hs-special">(</span><span id="local-6989586621681067846"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681067846"><span class="hs-identifier hs-var">tot_wds</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681067845"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681067845"><span class="hs-identifier hs-var">ptr_wds</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-66"></span><span>             </span><span class="annot"><span class="annottext">DynFlags -&gt; [NonVoid PrimRep] -&gt; (Int, Int)
</span><a href="GHC.StgToCmm.Layout.html#mkVirtConstrSizes"><span class="hs-identifier hs-var">mkVirtConstrSizes</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681067857"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">[NonVoid PrimRep]
</span><a href="#local-6989586621681067851"><span class="hs-identifier hs-var">rep_args</span></a></span><span>
</span><span id="line-67"></span><span>
</span><span id="line-68"></span><span>         </span><span id="local-6989586621681067844"><span class="annot"><span class="annottext">ptrs' :: Int
</span><a href="#local-6989586621681067844"><span class="hs-identifier hs-var hs-var">ptrs'</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681067845"><span class="hs-identifier hs-var">ptr_wds</span></a></span><span>
</span><span id="line-69"></span><span>         </span><span id="local-6989586621681067842"><span class="annot"><span class="annottext">nptrs' :: Int
</span><a href="#local-6989586621681067842"><span class="hs-identifier hs-var hs-var">nptrs'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681067846"><span class="hs-identifier hs-var">tot_wds</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681067845"><span class="hs-identifier hs-var">ptr_wds</span></a></span><span>
</span><span id="line-70"></span><span>         </span><span id="local-6989586621681067837"><span class="annot"><span class="annottext">nptrs_really :: Int
</span><a href="#local-6989586621681067837"><span class="hs-identifier hs-var hs-var">nptrs_really</span></a></span></span><span>
</span><span id="line-71"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681067844"><span class="hs-identifier hs-var">ptrs'</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681067842"><span class="hs-identifier hs-var">nptrs'</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Int
</span><a href="GHC.Driver.Session.html#mIN_PAYLOAD_SIZE"><span class="hs-identifier hs-var">mIN_PAYLOAD_SIZE</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681067857"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681067842"><span class="hs-identifier hs-var">nptrs'</span></a></span><span>
</span><span id="line-72"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Int
</span><a href="GHC.Driver.Session.html#mIN_PAYLOAD_SIZE"><span class="hs-identifier hs-var">mIN_PAYLOAD_SIZE</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681067857"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681067844"><span class="hs-identifier hs-var">ptrs'</span></a></span><span>
</span><span id="line-73"></span><span>
</span><span id="line-74"></span><span>         </span><span id="local-6989586621681067834"><span class="annot"><span class="annottext">descr :: ByteString
</span><a href="#local-6989586621681067834"><span class="hs-identifier hs-var hs-var">descr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; ByteString
</span><a href="GHC.Core.DataCon.html#dataConIdentity"><span class="hs-identifier hs-var">dataConIdentity</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681067855"><span class="hs-identifier hs-var">dcon</span></a></span><span>
</span><span id="line-75"></span><span>
</span><span id="line-76"></span><span>         </span><span id="local-6989586621681067833"><span class="annot"><span class="annottext">platform :: Platform
</span><a href="#local-6989586621681067833"><span class="hs-identifier hs-var hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Platform
</span><a href="GHC.Driver.Session.html#targetPlatform"><span class="hs-identifier hs-var hs-var">targetPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681067857"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-77"></span><span>         </span><span id="local-6989586621681067831"><span class="annot"><span class="annottext">tables_next_to_code :: Bool
</span><a href="#local-6989586621681067831"><span class="hs-identifier hs-var hs-var">tables_next_to_code</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; Bool
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformTablesNextToCode"><span class="hs-identifier hs-var hs-var">platformTablesNextToCode</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681067833"><span class="hs-identifier hs-var">platform</span></a></span><span>
</span><span id="line-78"></span><span>
</span><span id="line-79"></span><span>     </span><span id="local-6989586621681067829"><span class="annot"><span class="annottext">RemotePtr StgInfoTable
</span><a href="#local-6989586621681067829"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv
-&gt; Message (RemotePtr StgInfoTable) -&gt; IO (RemotePtr StgInfoTable)
forall a. Binary a =&gt; HscEnv -&gt; Message a -&gt; IO a
</span><a href="GHC.Runtime.Interpreter.html#iservCmd"><span class="hs-identifier hs-var">iservCmd</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681067861"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool
-&gt; Int
-&gt; Int
-&gt; Int
-&gt; Int
-&gt; ByteString
-&gt; Message (RemotePtr StgInfoTable)
</span><a href="../../ghci/src/GHCi.Message.html#MkConInfoTable"><span class="hs-identifier hs-var">MkConInfoTable</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681067831"><span class="hs-identifier hs-var">tables_next_to_code</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681067844"><span class="hs-identifier hs-var">ptrs'</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681067837"><span class="hs-identifier hs-var">nptrs_really</span></a></span><span>
</span><span id="line-80"></span><span>                              </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681067854"><span class="hs-identifier hs-var">conNo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; DataCon -&gt; Int
</span><a href="GHC.StgToCmm.Closure.html#tagForCon"><span class="hs-identifier hs-var">tagForCon</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681067857"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681067855"><span class="hs-identifier hs-var">dcon</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621681067834"><span class="hs-identifier hs-var">descr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-81"></span><span>     </span><span class="annot"><span class="annottext">(Name, ItblPtr) -&gt; IO (Name, ItblPtr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; Name
forall a. NamedThing a =&gt; a -&gt; Name
</span><a href="GHC.Types.Name.html#getName"><span class="hs-identifier hs-var">getName</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681067855"><span class="hs-identifier hs-var">dcon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">RemotePtr StgInfoTable -&gt; ItblPtr
</span><a href="GHC.ByteCode.Types.html#ItblPtr"><span class="hs-identifier hs-var">ItblPtr</span></a></span><span> </span><span class="annot"><span class="annottext">RemotePtr StgInfoTable
</span><a href="#local-6989586621681067829"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-82"></span></pre></body></html>